import request from '../request';

export interface dateReq{
    startDate:string,
    endDate:string
}

export enum StatisticsApi {
    ExchangeVolume = '/data/exchangeVolume',
    TopCategories = '/data/topCategories',
    ExchangeMethods = '/data/exchangeMethods',
}


export const exchangeVolume = (data: dateReq) => request.post({ url: StatisticsApi.ExchangeVolume, data });
export const topCategories = (data: dateReq) => request.post({ url: StatisticsApi.TopCategories, data });
export const exchangeMethods = (data:dateReq) => request.post({ url: StatisticsApi.ExchangeMethods,data});



export const getManageTableList = (params, sorter, filter) =>
    request.post({ url: `/manage/getManageTableList`, data: { params, sorter, filter } });

export const getProductByID = (productID) => {
    return request.get({ url: "/manage/getProductByID", params: { id: productID } })
}

export const shelfOFFByID = (productID) => {
    return request.get({ url: "/manage/shelfOff", params: { id: productID } })
}

export const doOperateForProduct = (data) => request.put({ url: "/manage/doOPerate", data })